<template>
  <div class="dashboard">
    <el-row class="divStatic">
      <el-col class="divLeft" :span="20">
        <div class="banner">
          <img class="img-left" src="http://www-wms-java.itheima.net/img/dashboard-banner-left@2x.5afd2949.png" alt="" />
          <img class="img-right" src="http://www-wms-java.itheima.net/img/dashboard-banner-right@2x.28195570.png" alt="" />
          <img class="user-header" src="http://www-wms-java.itheima.net/img/avatar@2x.4f4a758f.png" alt="" />
          <p class="user-title">仓储管理员</p>
          <p class="subject-title">我不是为了赢，我就是认真的</p>
          <p class="subject-author">—— 罗永浩</p>
          <div class="site">
            <p class="title">北京总仓</p>
          </div>
        </div>
        <div class="backlog">
          <div class="subject">待办信息</div>
          <div class="item-list">
            <el-row :gutter="30">
              <el-col :span="8">
                <div class="backlog-item">
                  <div style="background: rgb(0, 118, 255)" class="icon">
                    <i class="el-icon-sell"></i>
                  </div>
                  <div class="title"></div>
                  <div class="bottom">
                    <span class="spanlabel">新增</span>
                    <span class="spanValue">6</span>
                    <span class="spanlabel">待审核</span>
                    <span class="spanValue" style="color: rgb(0, 118, 255)">6</span>
                  </div>
                </div>
              </el-col>
              <el-col :span="8">
                <div  class="backlog-item">
                  <div style="background: rgb(255, 178, 0)" class="icon">
                    <i class="el-icon-sold-out"></i>
                  </div>
                  <div class="title"></div>
                  <div class="bottom">
                    <span class="spanlabel">新增</span>
                    <span class="spanValue">3</span>
                    <span class="spanlabel">待审核</span>
                    <span class="spanValue" style="color: rgb(255, 178, 0)">3</span>
                  </div>
                </div>
              </el-col>
              <el-col :span="8">
                <div  class="backlog-item">
                  <div style="background: rgb(255, 113, 0)" class="icon">
                    <i class="el-icon-shopping-bag-1"></i>
                  </div>
                  <div class="title"></div>
                  <div class="bottom">
                    <span class="spanlabel">新增</span>
                    <span class="spanValue">9</span>
                    <span class="spanlabel">待审核</span>
                    <span class="spanValue" style="color: rgb(255, 113, 0)">9</span>
                  </div>
                </div>
              </el-col>
            </el-row>
          </div>
        </div>
      </el-col>
      <el-col class="divRight" :span="4">
        <div class="notes">
          <div class="subject">通知/公告</div>
          <div class="item">
            <div class="hr"></div>
            <div class="title">紧急盘点通知</div>
            <div class="time">2020.12.30 18:23:14</div>
          </div>
          <div class="item">
            <div class="hr"></div>
            <div class="title">运维服务更新通知</div>
            <div class="time">2021.01.25 18:23:14</div>
          </div>
          <div class="item">
            <div class="hr"></div>
            <div class="title">客户入库变更通知</div>
            <div class="time">2021.01.26 18:23:14</div>
          </div>
          <div class="item">
            <div class="hr"></div>
            <div class="title">五一放假通知</div>
            <div class="time">2021.02.15 18:23:14</div>
          </div>
          <div class="item">
            <div class="hr"></div>
            <div class="title">品达物流系统对接通知</div>
            <div class="time">2021.3.25 18:23:14</div>
          </div>
        </div>
      </el-col>
    </el-row>
    <div class="tasks">
      <div class="subject">任务导航</div>
      <div class="item-list">
        <el-row :gutter="30" style="margin-left: -15px; margin-right: -15px">
          <el-col :span="5">
            <div  class="tasks-item">
              <div class="icon" style="background: rgb(0, 118, 255)">
                <i class="el-icon-shopping-cart-2"></i>
              </div>
              <div class="title">收货任务</div>
            </div>
          </el-col>
          <el-col :span="5">
            <div  class="tasks-item">
              <div class="icon" style="background: rgb(82, 212, 243)">
                <i class="el-icon-shopping-cart-1"></i>
              </div>
              <div class="title">上架任务</div>
            </div>
          </el-col>
          <el-col :span="5">
            <div class="tasks-item">
              <div class="icon" style="background: rgb(255, 113, 0)">
                <i class="el-icon-date"></i>
              </div>
              <div class="title">盘点任务</div>
            </div>
          </el-col>
          <el-col :span="5">
            <div class="tasks-item">
              <div class="icon" style="background: rgb(255, 96, 158)">
                <i class="el-icon-shopping-cart-full"></i>
              </div>
              <div class="title">拣货任务</div>
            </div>
          </el-col>
          <el-col :span="5">
            <div  class="tasks-item">
              <div class="icon" style="background: rgb(255, 178, 0)">
                <i class="el-icon-connection"></i>
              </div>
              <div class="title">交接任务</div>
            </div>
          </el-col>
        </el-row>
      </div>
    </div>
    <div class="inout-charts">
      <el-row class="header">
        <el-col :span="6">
          <p>入库/出库信息</p>
        </el-col>
        <el-col :span="18" class="bar">
          <el-button-group>
            <el-button @click="selectBar(index)" type="primary" v-for="(item, index) in bar.state" :key="index" :class="{ 'btn-active': bar.select === index }">
              {{ item }}
            </el-button>
          </el-button-group>
        </el-col>
      </el-row>
      <dashboardEcharts ></dashboardEcharts>
    </div>
    <div class="libs">
      <div class="use-charts">
        <div class="header">
          <p class="subject">库存使用情况</p>
        </div>
        <dashboardAccess></dashboardAccess>
      </div>
      <div class="libs-charts">
        <div class="header">
          <p class="subject">库区使用情况</p>
        </div>
        <dashboardArea></dashboardArea>
      </div>
    </div>
  </div>
</template>

<script>
import dashboardEcharts from './components/DashboardEcharts.vue'
import dashboardAccess from './components/DashboardAccess.vue'
import dashboardArea from './components/DashboardArea.vue'
export default {
  components: {
    dashboardEcharts,
    dashboardAccess,
    dashboardArea
  },
  data () {
    return {
      // backlog 数据
      todo: [],
      // 按钮组点击变色数据
      bar: {
        select: 0,
        state: ['本周', '本月', '本年']
      }
    }
  },
  created () {

  },
  methods: {
    selectBar (index) {
      this.bar.select = index
    }
  }
}
</script>

<style lang="scss" scoped>
.dashboard {
  .divStatic {
    width: 100%;
    // padding: 20px 30px 30px 30px;
    .divLeft {
      height: 451px;
      padding-right: 30px;
      .banner {
        position: relative;
        width: 100%;
        height: 148px;
        background: linear-gradient(270deg, #ffc771, #ffa634);
        box-shadow: 0 0 6px 0 rgb(188 151 69 / 12%);
        border-radius: 12px;
        .img-left {
          position: absolute;
          top: 0;
          left: 0;
          height: 148px;
        }
        .img-right {
          position: absolute;
          top: 0;
          right: 0;
          height: 148px;
        }
        .user-header {
          position: absolute;
          top: 31px;
          left: 43px;
          height: 62px;
        }
        .user-title {
          position: absolute;
          left: 36px;
          bottom: 20px;
          font-size: 16px;
          font-family: PingFangSC-Medium, PingFang SC;
          font-weight: 500;
          color: #332929;
          line-height: 22px;
        }
        .subject-title {
          position: absolute;
          font-family: PingFangSC-Medium, PingFang SC;
          font-weight: 500;
          color: #fff;
          line-height: 25px;
          top: 36px;
          left: 200px;
          font-size: 18px;
        }
        .subject-author {
          position: absolute;
          font-family: PingFangSC-Medium, PingFang SC;
          font-weight: 500;
          color: #fff;
          line-height: 25px;
          top: 76px;
          left: 400px;
          font-size: 16px;
        }
        p {
          padding: 0;
          margin: 0;
        }
        .site {
          position: absolute;
          top: 20px;
          right: 20px;
          width: 147px;
          height: 40px;
          background: #f8f5f5;
          border-radius: 6px;
          opacity: 0.79;
          display: flex;
          flex-direction: row;
          align-items: center;
          justify-content: space-around;
          .title {
            font-size: 14px;
            font-weight: 500;
            color: #332929;
            font-family: PingFangSC-Medium, PingFang SC;
            line-height: 20px;
          }
        }
      }
      .backlog {
        width: 100%;
        height: 282px;
        background: #fff;
        box-shadow: 0 0 6px 0 rgb(144 142 142 / 17%);
        border-radius: 12px;
        padding: 25px;
        margin-top: 20px;
        box-sizing: border-box;
        .subject {
          font-size: 16px;
          font-family: PingFangSC-Semibold, PingFang SC;
          font-weight: 600;
          color: #332929;
          line-height: 22px;
        }
        .item-list {
          margin-top: 19px;
          .backlog-item {
            position: relative;
            height: 186px;
            background: #fbf7f7;
            border-radius: 8px;
            padding: 20px;
            cursor: pointer;
            box-sizing: border-box;
            .icon {
              width: 49px;
              height: 49px;
              border-radius: 12px;
              display: flex;
              align-items: center;
              justify-content: space-around;
              box-sizing: border-box;
              i {
                font-size: 32px;
                color: #f8f5f5;
              }
            }
            .title {
              position: absolute;
              top: 34px;
              left: 85px;
              font-size: 16px;
              font-family: PingFangSC-Medium, PingFang SC;
              font-weight: 500;
              color: #332929;
              line-height: 22px;
              box-sizing: border-box;
            }
            .bottom {
              position: absolute;
              bottom: 20px;
              box-sizing: border-box;
              .spanlabel {
                font-size: 14px;
                font-family: PingFangSC-Regular, PingFang SC;
                font-weight: 400;
                color: #887e7e;
                margin-right: 10px;
                vertical-align: super;
                box-sizing: border-box;
              }
              .spanValue {
                font-size: 36px;
                font-family: DIN-Medium, DIN;
                font-weight: 500;
                color: #332929;
                margin-right: 20px;
                box-sizing: border-box;
              }
            }
          }
        }
      }
    }
    .divRight {
      height: 451px;
      .notes {
        width: 261px;
        height: 451px;
        background: #fff;
        box-shadow: 0 0 6px 0 rgb(144 142 142 / 17%);
        border-radius: 12px;
        padding: 30px;
        box-sizing: border-box;
        .subject {
          font-size: 16px;
          font-family: PingFangSC-Semibold, PingFang SC;
          font-weight: 600;
          color: #332929;
          line-height: 22px;
        }
        .item {
          margin-top: 15px;
          .hr {
            width: 201px;
            height: 1px;
            background-color: #f5efee;
          }
          .title {
            width: 195px;
            height: 18px;
            font-size: 13px;
            font-family: PingFangSC-Regular, PingFang SC;
            font-weight: 400;
            color: #332929;
            line-height: 18px;
            margin-top: 15px;
          }
          .time {
            width: 115px;
            height: 17px;
            font-size: 12px;
            font-family: PingFangSC-Regular, PingFang SC;
            font-weight: 400;
            color: #887e7e;
            line-height: 17px;
            margin-top: 10px;
          }
        }
      }
    }
  }
  .tasks {
    box-sizing: border-box;
    margin-top: 20px;
    width: 100%;
    height: 188px;
    background: #fff;
    box-shadow: 0 0 6px 0 rgb(144 142 142 / 17%);
    border-radius: 12px;
    padding: 25px;
    .subject {
      box-sizing: border-box;
      font-size: 16px;
      font-family: PingFangSC-Semibold, PingFang SC;
      font-weight: 600;
      color: #332929;
      line-height: 22px;
    }
    .item-list {
      box-sizing: border-box;
      margin-top: 19px;
      .el-row {
        position: relative;
        box-sizing: border-box;
        .el-col {
          width: 20%;
          .tasks-item {
            box-sizing: border-box;
            position: relative;
            width: 100%;
            height: 93px;
            background: #fbf7f7;
            border-radius: 8px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: space-evenly;
            .icon {
              box-sizing: border-box;
              width: 50px;
              height: 50px;
              border-radius: 25px;
              display: flex;
              align-items: center;
              justify-content: space-around;
              i {
                font-size: 28px;
                color: #f8f5f5;
              }
            }
            .title {
              font-size: 16px;
              font-family: PingFangSC-Medium, PingFang SC;
              font-weight: 500;
              color: #332929;
              line-height: 22px;
            }
          }
        }
      }
    }
  }
  .inout-charts {
    box-sizing: border-box;
    margin-top: 20px;
    height: 500px;
    background: #fff;
    box-shadow: 0 0 6px 0 rgb(144 142 142 / 17%);
    border-radius: 12px;
    padding: 25px;
    .header {
      position: relative;
      box-sizing: border-box;
      p {
        font-size: 16px;
        font-family: PingFangSC-Semibold, PingFang SC;
        font-weight: 600;
        color: #332929;
        line-height: 22px;
        margin: 0;
      }
      .bar {
        text-align: right;
        .el-button-group {
          button {
            background-color: #fff;
            color: RGB(31, 45, 61);
            border: 1px RGB(220, 223, 230) solid;
            width: 70px;
            height: 36px;
            line-height: 10px;
          }
          .btn-active {
            background-color: RGB(255, 178, 0);
            color: #fff;
          }
        }
      }
    }
  }
  .libs {
    box-sizing: border-box;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    margin-top: 20px;
    .use-charts {
      box-sizing: border-box;
      width: 30%;
      height: 354px;
      background: #fff;
      box-shadow: 0 0 6px 0 rgb(144 142 142 / 17%);
      border-radius: 12px;
      padding: 25px;
      margin-right: 30px;
      .header {
        .subject {
          margin: 0;
          font-size: 16px;
          font-family: PingFangSC-Semibold, PingFang SC;
          font-weight: 600;
          color: #332929;
          line-height: 22px;
        }
      }
    }
    .libs-charts {
      box-sizing: border-box;
      width: 70%;
      height: 354px;
      background: #fff;
      box-shadow: 0 0 6px 0 rgb(144 142 142 / 17%);
      border-radius: 12px;
      padding: 25px;
      .header {
        .subject {
          margin: 0;
          font-size: 16px;
          font-family: PingFangSC-Semibold, PingFang SC;
          font-weight: 600;
          color: #332929;
          line-height: 22px;
        }
      }
    }
  }
}
</style>
